home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
baswin22.arc
/
NEWSCRN.ASM
< prev
next >
Wrap
Assembly Source File
|
1986-11-30
|
5KB
|
103 lines
bios_data segment at 40h
org 10h
equip_flag label word
org 63h
addr_6845 label word
bios_data ends
code segment byte public 'CODE'
assume cs:code,ds:code
public savescrn, restscrn
savescrn proc far
push bp ;save for BASIC
mov bp,sp ;set up Base Pointer
push es ;save for BASIC
mov bx,6[bp] ;get location of array
mov si,[bx] ;
call get_set ;set up transfer conditions
push es ;exchange ES and DS registers
push ds ;since we are moving data
pop es ;from screen to array
pop ds ;
xchg si,di ;exchange indexes too
call go ;do transfer
push es ;restore ES and DS to proper
push ds ;values.
pop es ;
pop ds ;
pop es ;prepare to return to BASIC
pop bp ;
ret 4 ;go past 2 parameters
savescrn endp
restscrn proc far
push bp ;save for BASIC
mov bp,sp ;set up Base Pointer
push es ;save for BASIC
mov bx,6[bp] ;get location of array
mov si,[bx] ;
call get_set ;set up transfer conditions
call go ;do transfer
pop es ;prepare to return to BASIC
pop bp ;
ret 4 ;go past 2 parameters
restscrn endp
get_set proc near
xor di,di ;
mov cx,2000 ;number of transfers to do
mov bx,bios_data ;
mov es,bx ;point to BIOS data block
mov dx,es:addr_6845 ;set up DX to base of 6845
add dx,6 ;set it up for status port
mov ax,0B800H ;assume it is a color card
mov bx,es:equip_flag ;test to see if it is
and bx,30h ;
cmp bx,30h ;
jne ok ;ok it is color
mov ax,0B000H ;no, it's monochrome
ok: mov es,ax ;set up address in ES
ret
get_set endp
go proc near
mov ax,8[bp] ;get snowtest parameter
cmp ax,1 ;is it ok for no snow?
jz notest ;yes, do fast transfer
testcard: mov bx,es ;test destination
cmp bx,0B000H ;is it monochrome?
jz notest ;yes, do fast transfer
again: mov bx,ds ;test source
cmp bx,0B000H ;same here except for screen
jz notest ;restore
;if all above tests fail,
;card must be an IBM CGA
;and must test for snow
ibmcga: cli ;disable interrupts
test_lo: in al,dx ;test horizontal retrace
shr al,1 ;wait 'til it's low
jc test_lo ;
test_hi: in al,dx ;now test 'til it's high
shr al,1 ;
jnc test_hi ;
movsw ;ok now to move char and attr
loop test_lo ;do 2000 times for full screen
sti ;restore interrupts
ret
notest: movsw ;move character and attribute
loop notest ;do 2000 times
ret
go endp
code ends
end